﻿<UserControl x:Class="Chapters.Chapter18.RangeSelectorAutomationExample"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:Chapter18="clr-namespace:FSharp.Chapter18;assembly=FSharpLibrary">
    <DockPanel>
        <StackPanel Width="200">
            <TextBlock Text="{Binding Value, ElementName=MinimumSlider, StringFormat=Minimum: {0:F2}}" />
            <Slider x:Name="MinimumSlider"
                    Minimum="0"
                    Maximum="100"
                    Value="0" />

            <TextBlock Text="{Binding Value, ElementName=RangeStartSlider, StringFormat=RangeStart: {0:F2}}" />
            <Slider x:Name="RangeStartSlider"
                    Minimum="0"
                    Maximum="100"
                    Value="0" />

            <TextBlock Text="{Binding Value, ElementName=RangeEndSlider, StringFormat=RangeEnd: {0:F2}}" />
            <Slider x:Name="RangeEndSlider"
                    Minimum="0"
                    Maximum="100"
                    Value="0" />

            <TextBlock Text="{Binding Value, ElementName=MaximumSlider, StringFormat=Maximum: {0:F2}}" />
            <Slider x:Name="MaximumSlider"
                    Minimum="0"
                    Maximum="100"
                    Value="0" />
        </StackPanel>
        <Chapter18:RangeSelector x:Name="Selector"
                                 Width="200"
                                 Minimum="{Binding Value, ElementName=MinimumSlider}"
                                 Maximum="{Binding Value, ElementName=MaximumSlider}"
                                 RangeStart="{Binding Value, ElementName=RangeStartSlider, Mode=TwoWay}"
                                 RangeEnd="{Binding Value, ElementName=RangeEndSlider, Mode=TwoWay}" 
                                 AutomationProperties.AutomationId="Hello_RangeSelector"/>

    </DockPanel>
</UserControl>
